# -*- coding = utf-8 -*-
# @Time : 2023/4/4 2:16
# @Author : 龙王赘婿_彪少
# @File : steering_engine.py
# @Software: PyCharm

# 功能：

def crc():
    data = [0xFF, 0xFF, 0xFE, 0x04, 0x02, 0x05, 0x01]
    sum = 0
    for var in data[2:]:
        sum = sum + var
        print("%#.2x" % var)
    checksum = ~(sum & 0xff)
    print("%#2x" % checksum)


if __name__ == "__main__":
    crc()
